<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */

namespace App\Utils\Enum;

class CouponEnum
{
    /**
     * 未激活.
     */
    public const int STATUS_NOT_ACTIVE = 0;

    /**
     * 未使用.
     */
    public const int STATUS_USABLE = 1;

    /**
     * 已使用.
     */
    public const int STATUS_USED = 2;

    /**
     * 已过期
     */
    public const int STATUS_EXPIRED = 3;

    /**
     * 已销毁
     */
    public const int STATUS_DESTRUCT = 4;

    /**
     * 获取状态
     */
    public static function getStatus($status): string
    {
        return match ($status) {
            self::STATUS_NOT_ACTIVE => '未激活',
            self::STATUS_USABLE => '未使用',
            self::STATUS_USED => '已使用',
            self::STATUS_EXPIRED => '已过期',
            self::STATUS_DESTRUCT => '已销毁',
            default => '未知'
        };
    }
}
